package com.order;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
// 在项目的启动类上开启服务的注册与发现的注解（nacos，默认可以不用配置）
@EnableDiscoveryClient
// 启动OpenFeign的客户端
@EnableFeignClients
public class OrderStart {
    public static void main(String[] args) {
        SpringApplication.run(OrderStart.class,args);
    }
    @Bean
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}